package com.xiaoyu.studyworkspace.task;

import com.xiaoyu.studyworkspace.mapper.AutoRegisterMapper;
import com.xiaoyu.studyworkspace.pojo.AutoRegister;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class AutoFreshTask {

    @Autowired
    private AutoRegisterMapper autoRegisterMapper;

    /**
     * 每天10点30定时刷新
     */
    @Scheduled(cron = "0 30 22 * * ?")
    public void timedFresh() {
        AutoRegister autoRegister = new AutoRegister();
        autoRegister.setIs_transfer(0);
        autoRegisterMapper.updateAllUser(autoRegister);
    }
}
